package com.xunyin.enums;


/**
 * @Description:房间状态Enum Created by xunyinyunshang <3594419785@qq.com>
 * CopyRight 讯音云商 https://www.tonetn.com
 * @Date 2023/4/20
 */
public enum StoreRoomStatusEnum {

    IDLE(0, "空闲中"),
    USE(1, "使用中"),
    MODEL_TL(2, "待清洁"),
    REP(3, "维修");

    private int key;

    private String value;

    StoreRoomStatusEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    // 普通方法，通过key获取value
    public static String getValue(int k) {
        for (StoreRoomStatusEnum c : StoreRoomStatusEnum.values()) {
            if (c.getKey() == k) {
                return c.getValue();
            }
        }
        return null;
    }

    // 普通方法，通过Value获取key
    public static int getKey(String v) {
        for (StoreRoomStatusEnum c : StoreRoomStatusEnum.values()) {
            if (c.getValue() == v) {
                return c.getKey();
            }
        }
        return 0;
    }

}
